package cn.iocoder.yudao.module.api.promotion.fod.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 平台首单优惠类型枚举
 *
 * @author 山野羡民
 */
@AllArgsConstructor
@Getter
public enum FirstOrderDiscountTypeEnum implements EnumValuable {

    NEW_USER(1, "新用户"),
    NEW_VIP(2, "新会员"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    public static FirstOrderDiscountTypeEnum valueOf(Integer value) {
        for (FirstOrderDiscountTypeEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return NEW_VIP;
    }

}
